package com.zb.entity.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjAdmVersion;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/7/13 0013
 **/
@Data
@ApiModel("版本列表实体")
public class VersionList {
    @ApiModelProperty(value = "主健ID")
    private Long id;

    @ApiModelProperty(value = "版本编码")
    private String code;

    @ApiModelProperty(value = "版本名称")
    private String name;

    @ApiModelProperty(value = "是否工单无限制：0-否，1-是")
    private Boolean orderUnlimited;

    @ApiModelProperty(value = "工单限制数")
    private Integer orderLimitNum;

    @ApiModelProperty(value = "用户数")
    private Integer userQty;

    @ApiModelProperty(value = "类型：1-月，2-季度，3-年")
    private Integer type;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ApiModelProperty(value = "是否禁用：0-否，1-是")
    private Boolean disabled;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date UpdateTime;

    @ApiModelProperty(value = "模块名称集合")
    private List<String> modules;

    public static VersionList beanBoV(ZjAdmVersion version, List<String> modules) {
        VersionList versionList = new VersionList();
        BeanUtils.copyProperties(versionList, versionList);
        versionList.setCreateTime(version.getGmtCreate());
        versionList.setUpdateTime(version.getGmtUpdate());
        versionList.setModules(modules);
        return versionList;
    }
}
